fix getPercent method