fixed api to traverse folders