added error parsing