Fix issue in runTasks