fix error caused by python serialization