some script fixes