fix getAverage statistic functions