Add a check befor delete a task