fix bug with dynamic script caching