add some try catch to make the program resillient to handle the file not found problem