fixing script errors