     EXECUTE
       q
     into result 
-    USING geom, target_cols, geometry_level, segment_name;
+    USING geom, target_cols, boundary_id, segment_name;
     
     return result;
 

      LIMIT 1
      $query$
    INTO segment_name
    USING geom, geometry_level;

    q :=
      format($query$

                  'us.census.acs.B19001014',
                  'us.census.acs.B19001015',
                  'us.census.acs.B19001016',
                  'us.census.acs.B19001017'];
    RETURN QUERY
    EXECUTE
    'select * from cdb_observatory._OBS_Get($1, $2, $3, $4 )'
    USING geom, target_cols, time_span, boundary_id
    RETURN;
END;
$$ LANGUAGE plpgsql;
