fix bugs of encoding and decoding