added serialize support