diff --git a/httprl.nonblocktest.inc b/httprl.nonblocktest.inc
index 24cf7c7..751f6c1 100644
--- a/httprl.nonblocktest.inc
+++ b/httprl.nonblocktest.inc
@@ -14,7 +14,12 @@ function httprl_nonblockingtest_page() {
       || strpos($_GET['id'], 'httprl_') !== 0
       || $_GET['key'] != md5(drupal_get_private_key())
         ) {
-    drupal_exit();
+    if (substr(VERSION, 0, 1) >= 7) {
+      drupal_exit();
+    }
+    else {
+      exit;
+    }
   }
 
   // Release the lock, echo out that the lock was cleared and exit.
@@ -25,7 +30,12 @@ function httprl_nonblockingtest_page() {
     httprl_lock_release($_GET['id']);
   }
   echo t('lock @id cleared', array('@id' => $_GET['id']));
-  drupal_exit();
+  if (substr(VERSION, 0, 1) >= 7) {
+    drupal_exit();
+  }
+  else {
+    exit;
+  }
 }
 
 /**
