Updated scanner.py