Fixed file read bug