Fixing fail if principal id not found