Fixed crash if invalid URL is provided