Fix miss query switch bug