add deserialize and its unit test