fix reading file bug