add recurse option to traverse