add $maxScan support