add seiral state save and restore