fix BFS
stuck on DFS