added null useragentstring checking