switch scan and main