write then rename.