sorts group names & fixes grouping issue