diff --git a/auto_entitylabel.module b/auto_entitylabel.module
index 701a01f..28bfddc 100644
--- a/auto_entitylabel.module
+++ b/auto_entitylabel.module
@@ -173,6 +173,12 @@ function auto_entitylabel_entity_presave(EntityInterface $entity) {
  */
 function auto_entitylabel_entity_insert(EntityInterface $entity) {
   if ($entity instanceof ContentEntityInterface) {
+    drupal_register_shutdown_function('_auto_entitylabel_post_insert', $entity);
+  }
+}
+
+function _auto_entitylabel_post_insert(EntityInterface $entity) {
+  if ($entity) {
     $decorator = \Drupal::service('auto_entitylabel.entity_decorator');
     /** @var \Drupal\auto_entitylabel\AutoEntityLabelManager $decorated_entity */
     $decorated_entity = $decorator->decorate($entity);
