more optimization for Scriptrunning