#549 fix principal check