add some script functions