fixed race condition in task setup