fix exceptions when no user agent