Updated return logic after deletion of task