better error parsing