A better way to test if the userAgent string is empty