diff --git a/src/mol-plugin-ui/index.ts b/src/mol-plugin-ui/index.ts
index f890d9f8e2ea616e1780a2a49fe32638a51a8734..4b32f50fa698c9a20535fc663adb60d194cd0f8e 100644
--- a/src/mol-plugin-ui/index.ts
+++ b/src/mol-plugin-ui/index.ts
@@ -15,7 +15,7 @@ export async function createPluginUI(target: HTMLElement, spec?: PluginUISpec, o
     const ctx = new PluginUIContext(spec || DefaultPluginUISpec());
     await ctx.init();
     if (options?.onBeforeUIRender) {
-        await options?.onBeforeUIRender(ctx);
+        await options.onBeforeUIRender(ctx);
     }
     ReactDOM.render(React.createElement(Plugin, { plugin: ctx }), target);
     return ctx;