Add auto-mode switching.