fix bug with caching