maybe-fixed the file.write situation