fix toggle of views in controller