Adding connect/disconnect functionality to demo.