cleanup before local delete