fix some script issues