Finished BFS, encountered error