Added a disconnect function