add GROUP BY clause to select method