check first whether there is a user agent