Implement switching to retry query.