fix script issues