toggle button function moved