fix cache invalidation bug