add check of unpacking failed