Fix TaskManager crash