two functions for recursive scan dir and save files to array