fix bug in autoScan