asynchronous file write fix