added try catch to file read