better handling of subfolders