diff --git a/plugins/freelinking_nodetitle.inc b/plugins/freelinking_nodetitle.inc
index 35bd5f6..e426009 100644
--- a/plugins/freelinking_nodetitle.inc
+++ b/plugins/freelinking_nodetitle.inc
@@ -112,8 +112,9 @@
   if ($type != 'none') {
     $sql .= " AND type='%s'";    
     $result = db_query($sql, $title, $type);
+  } else {
+    $result = db_query($sql, $title);
   }
-  $result = db_query($sql, $title);
 
   $set = array();
   while ($res = db_fetch_object($result)) {
