stepping bfs termination