added the disconnect function in the controller