stricter parsing of eof state