fix critical file read bug