Modified the getAverageStat function

Now works with the reverted change in user->stats