Added support for group queries