program crashes on invalid url