fix crash on eof message