Fix duplicate viewer insertion bug