avoid spurious eof exception