Add connect function