bug fix on file read