clean up before revert