added error message parsing