fixed encoding / decoding