fixed the is_prime method