add connect main method