fix toggle bugs