fixed the issue with grouping