modified the serialization process