implement range setup for scan_tab,still buggy