Fix tasksMap pointer error