fix bug about EOF reporting