adds urlopen exception handling, and some exception handling to allow testing in mac