catch eof exception