added try-except to url handling