fixed eof bug