Added try catch for file not found
added directory support