Viewer destructor bug fixed