lastPercentage scope bug