diff --git a/references_dialog.dialog_widgets.inc b/references_dialog.dialog_widgets.inc
index 02efc48..854f604 100644
--- a/references_dialog.dialog_widgets.inc
+++ b/references_dialog.dialog_widgets.inc
@@ -116,7 +116,10 @@ function references_dialog_node_reference_edit_link($element, $widget_settings,
       return array(
         array(
           'title' => t('Edit'),
-          'href' => 'node/' . $value . '/edit'
+          'href' => 'node/' . $value . '/edit',
+          'query' => array(
+            'entity_type' => 'node',
+          ),
         ),
       );
     }
@@ -141,6 +144,9 @@ function references_dialog_node_reference_add_link($element, $widget_settings, $
         $add_links[] = array(
           'title' => t('Create @type', array('@type' => $node_type->name)),
           'href' => 'node/add/' . strtr($type, array('_' => '-')),
+          'query' => array(
+            'entity_type' => 'node',
+          ),
         );
       }
     }
@@ -188,6 +194,9 @@ function references_dialog_user_reference_edit_link($element, $widget_settings,
     $user_links[] = array(
       'title' => t('Edit'),
       'href' => 'user/' . $value . '/edit',
+      'query' => array(
+        'entity_type' => 'user',
+      ),
     );
   }
   return $user_links;
@@ -207,7 +216,10 @@ function references_dialog_user_reference_add_link($element, $widget_settings, $
   if (user_access('administer users')) {
     $user_links[] = array(
       'title' => t('Create user'),
-      'href' => 'admin/people/create'
+      'href' => 'admin/people/create',
+      'query' => array(
+        'entity_type' => 'user',
+      ),
     );
   }
   return $user_links;
@@ -231,6 +243,9 @@ function references_dialog_entityreference_edit_link($element, $widget_settings,
           array(
             'title' => t('Edit'),
             'href' => references_dialog_get_admin_path($entity_type, 'edit', NULL, $entity),
+            'query' => array(
+              'entity_type' => $entity_type,
+            ),
           ),
         );
       }
@@ -312,6 +327,9 @@ function references_dialog_entityreference_link_helper($entity_type, $bundle = N
     $link = array(
       'title' => t('Create @type', array('@type' => $label)),
       'href' => $path,
+      'query' => array(
+        'entity_type' => $entity_type,
+      ),
     );
     return $link;
   }
@@ -360,7 +378,10 @@ function references_dialog_term_reference_edit_link($element, $widget_settings,
       return array(
         array(
           'title' => t('Edit'),
-          'href' => $path['path'] . '/edit'
+          'href' => $path['path'] . '/edit',
+          'query' => array(
+            'entity_type' => 'taxonomy_term',
+          ),
         ),
       );
     }
@@ -377,6 +398,9 @@ function references_dialog_term_reference_add_link($element, $widget_settings, $
     $add_links[] = array(
       'title' => t('Create @type', array('@type' => strtoupper($field['settings']['allowed_values'][0]['vocabulary']))),
       'href' => 'admin/structure/taxonomy/' . $field['settings']['allowed_values'][0]['vocabulary'] . '/add',
+      'query' => array(
+        'entity_type' => 'taxonomy_term',
+      ),
     );
   }
   return $add_links;
diff --git a/references_dialog.module b/references_dialog.module
index 9612a04..abbd151 100644
--- a/references_dialog.module
+++ b/references_dialog.module
@@ -409,7 +409,7 @@ function template_process_references_dialog_page(&$variables) {
 function references_dialog_entity_insert($entity, $entity_type) {
   // If we are in a dialog, we want to make sure that we redirect to the
   // the close dialog page, so that the dialog may be closed.
-  if (references_dialog_in_dialog() && references_dialog_close_on_submit()) {
+  if (references_dialog_check_entity_type($entity_type) && references_dialog_in_dialog() && references_dialog_close_on_submit()) {
     references_dialog_close_on_redirect($entity, $entity_type);
   }
 }
@@ -418,12 +418,28 @@ function references_dialog_entity_insert($entity, $entity_type) {
  * Implements hook_entity_update().
  */
 function references_dialog_entity_update($entity, $entity_type) {
-  if (references_dialog_in_dialog() && references_dialog_close_on_submit()) {
+  if (references_dialog_check_entity_type($entity_type) && references_dialog_in_dialog() && references_dialog_close_on_submit()) {
     references_dialog_close_on_redirect($entity, $entity_type);
   }
 }
 
 /**
+ * Checks if the updated/created entity has the expected entity_type.
+ *
+ * @param $entity_type
+ *   The expected entity_type.
+ * @return bool
+ *   TRUE if the expected type is given, FALSE if not.
+ *   TRUE as default, if information is not available.
+ */
+function references_dialog_check_entity_type($entity_type) {
+  if (!empty($_GET['entity_type'])) {
+    return $_GET['entity_type'] == $entity_type;
+  }
+  return TRUE;
+}
+
+/**
  * Sets our destination parameter so that the dialog will close itself after
  * redirect is completed.
  */
