further scriptcache improvement