Fix the file reader and writer (Bug exist when running on Windows)