bug in the grouping solved