fix parsing of error code