fix bug with BFSdebug method