Added functions to control the toggle buttons