auto revert before writing