early stop version for query testing