fixed statistics average bug