fix toggle button bug