Added user agent parsing