fix principal bug