fix script errors