final cleanup before commit