added the disconnect function