Fix bug where undeleted tasks are added to deletedTasks file.