Fix bug in taskcontroller.