Fixed stack overflow error with idle task.