added error handling in recursive directory search.