fixing group_by