diff --git a/robotstxt.module b/robotstxt.module
index 2f01f24..1f098f5 100755
--- a/robotstxt.module
+++ b/robotstxt.module
@@ -69,7 +69,7 @@ function robotstxt_robots() {
 
   drupal_add_http_header('Content-type', 'text/plain');
   echo implode("\n", $content);
-  exit;
+  drupal_exit();
 }
 
 /**
