bug fix: pdecode must unpack first then decode