cleanup before revert