fixed bug with wrong pointer in unpack call