avoid null pointer
user agent detection