fix error when parsing invalid url