wait for all subtasks to finish