added try catch block when parsing json
added __dirname to file path