refactored delete

- moved condition for checking if task exists into isExistingTask(Task
task)