fixed an index bug in xGroupBy