diff --git a/sites/all/modules/views_php/plugins/views/views_php_plugin_pager.inc b/sites/all/modules/views_php/plugins/views/views_php_plugin_pager.inc
old mode 100644
new mode 100755
index 3a418e9..b19d0cc
--- a/sites/all/modules/views_php/plugins/views/views_php_plugin_pager.inc
+++ b/sites/all/modules/views_php/plugins/views/views_php_plugin_pager.inc
@@ -36,8 +36,10 @@ class views_php_plugin_pager extends views_php_plugin_wrapper  {
         }
       }
     }
-
-    $this->wrapped->total_items = count($this->wrapped->view->result);
+    if (!isset($this->wrapped->total_items)) {
+      $this->wrapped->total_items = count($this->wrapped->view->result);
+    }
     $this->wrapped->update_page_info();
 
     $item_per_page = $this->wrapped->get_items_per_page();
