Our first cat Sydney did that too! She welcomed everybody by turning around their legs, but as soon as they bent down and petted him, he used to bite! He even did it with us; he let us pet him a while, changed his mind all of a sudden, and gave us a bite or/and a scratch ; he kept doing this, even when he was grown up!