add serialize method