diff --git a/cesnet-central/deployments/fullhub.yaml b/cesnet-central/deployments/fullhub.yaml
index 3ccc80d728c9d96d11274a1ba1824aec5a38f485..b3ff7e375b430e23f0c5e64daabe11b6711bfd92 100644
--- a/cesnet-central/deployments/fullhub.yaml
+++ b/cesnet-central/deployments/fullhub.yaml
@@ -152,8 +152,9 @@ singleuser:
 
         # Disables RTC extension. To enable it set this env variable in kubespawner_override
         # to JUPYTERHUB_ALLOW_TOKEN_IN_URL="1"
-        if [ -z JUPYTERHUB_ALLOW_TOKEN_IN_URL ]; then
+        if [ -z "$JUPYTERHUB_ALLOW_TOKEN_IN_URL" ]; then
           jupyter-labextension  disable @jupyter/collaboration-extension
+          jupyter-labextension lock @jupyter/collaboration-extension
         fi
 
         cd .
diff --git a/common/deployments/hub-production.yaml b/common/deployments/hub-production.yaml
index d3d50ced1665cb8f2d3121c7c789b5d57366151c..1d90b1cc37ce252e93f2a92685c0f49c4961745d 100644
--- a/common/deployments/hub-production.yaml
+++ b/common/deployments/hub-production.yaml
@@ -134,8 +134,9 @@ singleuser:
 
         # Disables RTC extension. To enable it set this env variable in kubespawner_override
         # to JUPYTERHUB_ALLOW_TOKEN_IN_URL="1"
-        if [ -z JUPYTERHUB_ALLOW_TOKEN_IN_URL ]; then
+        if [ -z "$JUPYTERHUB_ALLOW_TOKEN_IN_URL" ]; then
           jupyter-labextension  disable @jupyter/collaboration-extension
+          jupyter-labextension lock @jupyter/collaboration-extension
         fi
 
         cd .
diff --git a/common/deployments/hub-staging.yaml b/common/deployments/hub-staging.yaml
index 42ecb45b68207e5b76d86e739b1865aaca0d4245..0e22e4d0cc0674d8942738613e1093a5a7c78e31 100644
--- a/common/deployments/hub-staging.yaml
+++ b/common/deployments/hub-staging.yaml
@@ -134,8 +134,9 @@ singleuser:
 
         # Disables RTC extension. To enable it set this env variable in kubespawner_override
         # to JUPYTERHUB_ALLOW_TOKEN_IN_URL="1"
-        if [ -z JUPYTERHUB_ALLOW_TOKEN_IN_URL ]; then
+        if [ -z "$JUPYTERHUB_ALLOW_TOKEN_IN_URL" ]; then
           jupyter-labextension  disable @jupyter/collaboration-extension
+          jupyter-labextension lock @jupyter/collaboration-extension
         fi
 
         cd .
diff --git a/testing/deployments/hub.yaml b/testing/deployments/hub.yaml
index 2e4b3b53f52df6d58bc7e579f996746af17b8066..08aa541181a6e88a197a73d83588cb846a0f6ba1 100644
--- a/testing/deployments/hub.yaml
+++ b/testing/deployments/hub.yaml
@@ -135,8 +135,9 @@ singleuser:
 
         # Disables RTC extension. To enable it set this env variable in kubespawner_override
         # to JUPYTERHUB_ALLOW_TOKEN_IN_URL="1"
-         if [ -z JUPYTERHUB_ALLOW_TOKEN_IN_URL ]; then
+        if [ -z "$JUPYTERHUB_ALLOW_TOKEN_IN_URL" ]; then
           jupyter-labextension  disable @jupyter/collaboration-extension
+          jupyter-labextension lock @jupyter/collaboration-extension
         fi
 
         cd .