added nested aggregation support