Committing changes before rewrite