make distribute-aggregate flushing smarter