fixed bug in BFSNode