fixed caching of wrong variable