fix eof errors