add limit and sortMetric