improved script cache. #9