fix grouping of gems