Added logic for click button and toggle button.