Update task destroy logic