add connect function