reverted to using principalId as primary identifier for principals