fixed a bug in statistics