Moved destroy callback to fire after dom changes are reverted