urlopen inside the try except block