some script improvement