destroy event when the task is done