Fix the perm check