fix groupby method