fixed a bug in unpack

wow it was really busted huh