update avergetCost
update cost