"undefined" bug fixed, openedDocument rename to openPreview