Added URL error handling