matching original fetch.sh folder logic