Added support for group by