fix batch-size limit in discovery loop