Close the scanner.