Safe write fix