fixed a bug with file read