bug fix in average pgg calculation