fix bug for statistics