fixed panic message in Encode and Decode.