Fixing a race condition in destroy