encode/decode problems