add a verification at the beginning of decode/encodePayload();