Changes to use scan_id