make sure panels get toggled when switching views