Added try and except

For opening an url.