adding in logic and function for clearing all caches.