validity for scanning.
fixed debugging mode