fix Agent::setAsUserProfile function