fix groupBy ordering casing bug