diff --git a/token.tokens.inc b/token.tokens.inc
index 90fcaa0..597406e 100644
--- a/token.tokens.inc
+++ b/token.tokens.inc
@@ -1485,6 +1485,14 @@ function _token_field_label($entity_type, $field_name) {
  * Implements hook_tokens() on behalf of field.module.
  */
 function field_tokens($type, $tokens, array $data = array(), array $options = array(), BubbleableMetadata $bubbleable_metadata) {
+  static $level = 0, $count = 0;
+  global $field_tokens_static_reset;
+  if ($field_tokens_static_reset) {
+    $level =$count = 0;
+    $field_tokens_static_reset = FALSE;
+  }
+  $level++;
+  $count++;
   $replacements = array();
   $langcode = isset($options['langcode']) ? $options['langcode'] : NULL;
   // Entity tokens.
@@ -1492,6 +1500,7 @@ function field_tokens($type, $tokens, array $data = array(), array $options = ar
     /* @var \Drupal\Core\Entity\ContentEntityInterface $entity */
     $entity = $data['entity'];
     if (!($entity instanceof ContentEntityInterface)) {
+      $level--;
       return $replacements;
     }
 
@@ -1506,6 +1515,7 @@ function field_tokens($type, $tokens, array $data = array(), array $options = ar
     $view_display = \Drupal::entityTypeManager()->getStorage('entity_view_display')->load($view_mode_name);
     $token_view_display = (!empty($view_display) && $view_display->status());
     foreach ($tokens as $name => $original) {
+      dd($level, "$count-entity-$original");
       // For the [entity:field_name] token.
       if (strpos($name, ':') === FALSE) {
         $field_name = $name;
@@ -1584,6 +1594,7 @@ function field_tokens($type, $tokens, array $data = array(), array $options = ar
   }
   elseif (!empty($data['field_property'])) {
     foreach ($tokens as $token => $original) {
+      dd($level, "$count-field-$original");
       $filtered_tokens = $tokens;
       $delta = 0;
       $parts = explode(':', $token);
@@ -1688,6 +1699,7 @@ function field_tokens($type, $tokens, array $data = array(), array $options = ar
       }
     }
   }
+  $level--;
   return $replacements;
 }
 
