clean up commit before writing destructors