bug fix for principal permission.