fix check_perm issue