FileWrite bug fixed