fix grouping errors