add reading directory recrusively function