serialize and object persist