fixed bugs with threaded primes