Adding protobuf and serializing state