handle hierarchical folders