fix error when url is not parsed correctly