[Tunji] X fixed the bug in calculating total stats