fix discovery query