Instances creation Query Class fix