Added URL error checking