automatic mode selection