added a check if HTTP_USER_AGENT is set
Merge pull request #3 from hykw/bugfix

added a check if HTTP_USER_AGENT is set