added functionality to toggle button