update UI and add switch button.