Change query objid to id