run before commit