Adding in cache invalidation logic