Fixed exception emerging after closing PDFViewer