fix some viewing permission bugs