fixed a bug causing the program to crash when a task was started.