diff --git a/domain_finder.module b/domain_finder.module
index 424b14a..224624f 100755
--- a/domain_finder.module
+++ b/domain_finder.module
@@ -149,21 +149,29 @@ function domain_finder_theme() {
  */
 function domain_finder_preprocess_domain_finder_result(&$variables) {
   // Creating variables to domain-finder-result.tpl.php
-  $result = $variables['result'];
-  $variables['domain_name'] = check_plain($result['regrinfo']['domain']['name']);
-  $variables['domain_registered'] = $result['regrinfo']['registered'] == 'yes' ? TRUE : FALSE;
-  if ($variables['domain_registered']) {
-    $variables['domain_attributes'] = 'domain engage';
-    $variables['output_text'] = t('We are sorry but %domain_name domain is unavailable.', array('%domain_name' => $variables['domain_name']));
+  if (isset($variables['result']) && isset($variables['result']['regrinfo'])) {
+    $result = $variables['result'];
+    $variables['domain_name'] = check_plain($result['regrinfo']['domain']['name']);
+    $variables['domain_registered'] = $result['regrinfo']['registered'] == 'yes' ? TRUE : FALSE;
+    if ($variables['domain_registered']) {
+      $variables['domain_attributes'] = 'domain engage';
+      $variables['output_text'] = t('We are sorry but %domain_name domain is unavailable.', array('%domain_name' => $variables['domain_name']));
+    }
+    else {
+      $variables['domain_attributes'] = 'domain free';
+      $variables['output_text'] = t('%domain_name domain is free.', array('%domain_name' => $variables['domain_name']));
+    }
+    // More variables available from:
+    // $result['regrinfo']
+    // $result['regyinfo']
+    // $result['rawdata']
   }
   else {
-    $variables['domain_attributes'] = 'domain free';
-    $variables['output_text'] = t('%domain_name domain is free.', array('%domain_name' => $variables['domain_name']));
+    $variables['domain_name'] = '';
+    $variables['domain_registered'] = FALSE;
+    $variables['domain_attributes'] = '';
+    $variables['output_text'] = '';
   }
-  // More variables available from:
-  // $result['regrinfo']
-  // $result['regyinfo']
-  // $result['rawdata']
 }
 
 /**
