fixed NaN error in percentages