Added toggleConnect method