diff --git a/delete_orphaned_terms.module b/delete_orphaned_terms.module
index bc1b246..4b6ef42 100644
--- a/delete_orphaned_terms.module
+++ b/delete_orphaned_terms.module
@@ -181,7 +181,8 @@ function _delete_orphaned_terms_vocab_names($verbose = FALSE, $show_if_tags = FA
   $vocabularies = taxonomy_get_vocabularies();
   foreach ($vocabularies as $vocabulary) {
     $vocab_names[$vocabulary->vid] = $vocabulary->name;
-    $count = count(taxonomy_get_tree($vocabulary->vid));
+    $count = db_query('SELECT count(tid) as amount FROM {taxonomy_term_data} WHERE vid = :vid', array(':vid' => $vocabulary->vid))
+      ->fetchField();
     if ($verbose) {
       $vocab_names[$vocabulary->vid] .= ' (' . $count . ' terms)';
     }
