If the next task in the queue gets canceled, we need to adjust the iterator to the next task, otherwise a canceled task gets executed.
If the next task in the queue gets canceled, we need to adjust the iterator to the next task, otherwise a canceled task gets executed.