add serialization and deserialization