refactor query result container
add condition when vertex is ended