Add stop-processing logic to scanner