diff --git a/projects/common/components/geometry/geometry.component.ts b/projects/common/components/geometry/geometry.component.ts
index 2ff36d64e8c7c1722070a63b6c7841d832bb8b29..42953c6425600fe7bf169d68483b4f782778e9bf 100644
--- a/projects/common/components/geometry/geometry.component.ts
+++ b/projects/common/components/geometry/geometry.component.ts
@@ -48,9 +48,11 @@ export class GeometryComponent extends ElementComponent implements AfterViewInit
 
   ngAfterViewInit(): void {
     this.externalResourceService.initializeGeoGebra(this.renderer);
-    this.externalResourceService.isGeoGebraLoaded().subscribe((isLoaded: boolean) => {
-      if (isLoaded) this.initApplet();
-    });
+    this.externalResourceService.isGeoGebraLoaded()
+      .pipe(takeUntil(this.ngUnsubscribe))
+      .subscribe((isLoaded: boolean) => {
+        if (isLoaded) this.initApplet();
+      });
   }
 
   refresh(): void {