fix locality inversion bug in TaskManager