Fix caching bug