fixed bug in percentage calc