fixed unpacking bug