fixed unpack bug