bug fix in statistics