add initialization for sort and agg