add serialize and deserialize