check if user agent is set before further processing