Fixed the scanner reading from the filename instead of the actual file