fix file reading