visit tree to get path