solve a bug on the primes problems