fixed race condition that resulted in a task timeout everytime