fix avgPrices update bug