- add crawlDirectory helper function