Handling multiple subfolders in a script