revert on write error