Close scanner object