fixed the file reading