use treeAggregate instead of aggregate