add serialize function, maybe tmp