Add ModalDialog for switch branch errors