added logging to figure out why the last batch size is reported incorrectly