Fixed implementation of overwrite logic
Recursively process the whole folder tree