fix error message serialization bug