fix avrg processing