fix error serialization