added usertype checking query