fix unexpected eof