added the query for traids