corrected connect method