add groupby, orderby, limit and add hook function