fix a little bug in caching