added error handling to arser