fixed some script issues