fix reputation calculation