fix bug in caching?