use offsetScan instead of magic number