fix fs write problem