defined connect method