moved scan_mode_check