fix cache management.