add encodeSerialization