fix reading from file issue