convert deepFileListing to higher order function to be compatible with async call