added connect function