added limit check in primeCache