Adding connect function.