fix infinite-loop error in myPow