fixing unpair bug