better loopback detection