better perm checking