fixing script issues