Fix Sandbox clearing on Detach