add sorting function on statistic page