added error catch to parser