added user agent function