#152 use a local counter to determine whether or not at end-of-batch.