implemented cache invalidation