added function for serializing struct to client