fix eof issue