added switch for scanning with lockin on/off