refine CacheManager
fix an bug in cache manager