fix order and eof