fix percentage calc bug