Solved problem when reading file