fixing caching bug