These checks should happen in the task.cancel method