use a global varible to marked the found nodes, avoid repeat finding