diff --git a/wordcount.module b/wordcount.module
index 84120f5..bfe97bd 100644
--- a/wordcount.module
+++ b/wordcount.module
@@ -42,7 +42,7 @@ function wordcount_show_count() {
   // Count words.
   $rows = array();
 
-  $posts = db_query("SELECT nr.title, frb.body_value AS body, nr.uid, u.name FROM {node_revision} AS nr, {node} AS n, {users} AS u, {field_revision_body} AS frb WHERE nr.vid=n.nid AND u.uid=nr.uid AND nr.vid=frb.revision_id AND n.nid=frb.entity_id AND frb.entity_type='node'");
+  $posts = db_query("SELECT nr.title, frb.body_value AS body, nr.uid, u.name FROM {node_revision} AS nr, {node} AS n, {users} AS u, {field_revision_body} AS frb WHERE nr.nid=n.nid AND u.uid=nr.uid AND nr.vid=frb.revision_id AND n.nid=frb.entity_id AND n.vid=frb.revision_id AND frb.entity_type='node' order by u.uid asc");
   foreach ($posts as $post) {
     $id = $post->uid;
     if (!isset($rows[$id])) {
@@ -107,4 +107,4 @@ function wordcount_show_count() {
   $output = theme('table', $vars);
 
   return $output;
-}
\ No newline at end of file
+}
