Added connect function