fixed endless loop in sniff