Fixed UA sniff code