fixed decoding bug