nested aggregation testing query