Close the scanner