Fix switching between views