Fix the error when no task is available