fix for when we end a task so we delete the task file and re-create it