diff --git a/textcaptcha.module b/textcaptcha.module
index ffb1e62..7142ee2 100644
--- a/textcaptcha.module
+++ b/textcaptcha.module
@@ -208,6 +208,7 @@ function textcaptcha_get_new_challenges() {
       )
     );
     drupal_set_message($text, 'success');
+    textcaptcha_update_question_count();
   }
 }
 
@@ -352,10 +353,10 @@ function textcaptcha_cron() {
 function textcaptcha_get_random_question() {
   $textcaptcha = array();
 
+  $random_row = rand(0, textcaptcha_get_question_count() - 1);
   $result = db_select('textcaptcha_questions', 'q')
     ->fields('q')
-    ->range(0, 1)
-    ->orderRandom()
+    ->range($random_row, 1)
     ->execute()
     ->fetchAssoc();
 
@@ -375,6 +376,49 @@ function textcaptcha_get_random_question() {
 }
 
 /**
+ * Retrieve the number of questions cached in your local database.
+ *
+ * @return int
+ *   Returns the number of textcaptcha questions cached in the database.
+ */
+function textcaptcha_get_question_count() {
+  $textcaptcha_question_count = variable_get('textcaptcha_question_count');
+  if (isset($textcaptcha_question_count)) {
+    return $textcaptcha_question_count;
+  }
+  return textcaptcha_update_question_count();
+}
+
+/**
+ * Update the question count in the variables table, and return the count.
+ *
+ * @return int
+ *   Returns the number of textcaptcha questions cached in the database.
+ */
+function textcaptcha_update_question_count() {
+  $query = db_select('textcaptcha_questions', 'q')
+     ->fields('q', array('qid'));
+  $query->addExpression('COUNT(qid)', 'question_count');
+  $results = $query->execute()->fetchAssoc();
+
+  if ($results) {
+    $textcaptcha_question_count = $results['question_count'];
+  }
+  else {
+    watchdog('textcaptcha', 'The COUNT query failed. Please check your database to ensure the schema was installed properly');
+  }
+
+  if ($results && $textcaptcha_question_count == 0) {
+    watchdog('textcaptcha', "There are no questions cached in the database. You may want to cache more questions with 'drush textcaptcha-fetch', the options at 'admin/config/people/captcha/textcaptcha' or by running cron.");
+  }
+
+  $textcaptcha_question_count = $textcaptcha_question_count == NULL ? 0 : $textcaptcha_question_count;
+  variable_set('textcaptcha_question_count', $textcaptcha_question_count);
+
+  return $textcaptcha_question_count;
+}
+
+/**
  * Custom CAPTCHA validation callback.
  */
 function textcaptcha_captcha_validate($solution, $response) {
