switch from setre{gui/uid} -> setres...
handle get_agent's return appropriately