Added serializing using protobuf