Revert "replace multiple endTasks with one final endTasks"
Revert "replace multiple endTasks with one final endTasks"

This reverts commit 282dbb37d17e4aeed41c131c53b510554888ab65.

amplitude/Amplitude-iOS,amplitude/Amplitude-iOS,amplitude/Amplitude-iOS,amplitude/Amplitude-iOS