make sure to remove a viewer in all appropriate cases