fixed file reading