diff --git a/src/Plugin/collect/Schema/FetchUrlSchema.php b/src/Plugin/collect/Schema/FetchUrlSchema.php
index 525eb91..cd60025 100644
--- a/src/Plugin/collect/Schema/FetchUrlSchema.php
+++ b/src/Plugin/collect/Schema/FetchUrlSchema.php
@@ -96,8 +96,7 @@ class FetchUrlSchema extends SchemaBase implements SpecializedDisplaySchemaInter
     }
 
     // The response body.
-    $current_url = explode('/', \Drupal::requestStack()->getCurrentRequest()->getRequestUri());
-    $collect_container_id = end($current_url);
+    $collect_container_id = \Drupal::requestStack()->getCurrentRequest()->get('collect_container')->id();
     $url = \Drupal::url('collect.generate_page', ['collect_container' => $collect_container_id], ['absolute' => TRUE]);
     $output['body'] = array(
       '#type' => 'link',
