monkeypatch to fix the invalidURIerror