fixed file read bug