Add togglebutton functionality