add group by clause