fixed the connect/disconnect