bug fix in permission system