added method to regenerate the cache