add debug option to viewer