Update disconnect logic