reset of BFS