fix isPrime method
Two problems solved