Iteration over the tasks should be done with a copy.