modified Lan_mode_select_function