get user agent earlier