fix query in statistic