fixed bug with --scan.