implement connect/disconnect