fix a bug on serialization