select and group by seem to be working