made DecodeJson and EncodeJson invariant