def queryadmin working