fixed problem in bfs solver