fix unpack errors