final fix in... needed to access invariant of agent id if parent == -1.