fix caching of scope