added error handling to json reader