Updated connect method