example with mode selection