UserAgent error handling improved