added caching of the scripts