fixed bug in statistics