cast user agent to string