added query checking for different VE version