def thd(conn):

            tbl = self.db.model.steps
            wc = (tbl.c.id == stepid)
            q = sa.select([tbl.c.urls_json],
                          whereclause=wc)
            res = conn.execute(q)
            row = res.fetchone()
            if _racehook is not None:
                _racehook()
            urls = json.loads(row.urls_json)

            url_item = dict(name=name, url=url)

            if url_item not in urls:
                urls.append(url_item)
                q = tbl.update(whereclause=wc)
                conn.execute(q, urls_json=json.dumps(urls))