fix fs write file