if ``viewer`` is null, this will fail badly (I guess it's unlikely, but possible)