adapted to the current version and to the fact that the expcluded folders can also exist in subfolders