fixed bug in Scan