Update disconnect function