fix decoding bug