fix bug of groupby