rerfactor
modified iterator to stop when find entered node