Solved bug in setting principal
House keeping