fixed the fread() bug in another place

Detected the same issue in another place