BUG: fix caching bug