corrected unpack script