modified for traverse nodes