Fixed the count group by