fix toggle bugs.