fix caching bug