fixes eof parsing