retry write file