added check for availability of request.META.HTTP_USER_AGENT