Fixed extra queries on endpoint switching