Added -R option to include directories recursively.
added error handling in recursive directory search.