add aggregate query