--- a/community_tags/community_tags.module	2011-05-06 13:39:35.000000000 +0300
+++ b/community_tags/community_tags.module	2011-05-12 15:10:07.000000000 +0300
@@ -1497,14 +1497,15 @@
               // See if the term exists in the chosen vocabulary
               // and return the tid, otherwise, add a new record.
               $matching_terms = taxonomy_get_term_by_name($tag);
-              $matching_term = NULL; // tid match if any.
+              $match = FALSE; // tid match if any.
               foreach ($matching_terms as $matching_term) {
                 if ($matching_term->vid == $vid) {
+									$match = TRUE;
                   break;
                 }
               }
 
-              if (!$matching_term) {
+              if ($match == FALSE) {
                 $processed_terms[$vid]['new tags'][] = $tag;
               }
               else {
