diff --git a/dialog/example/dialog_example.module b/dialog/example/dialog_example.module
index 21d6bfa..3527b15 100644
--- a/dialog/example/dialog_example.module
+++ b/dialog/example/dialog_example.module
@@ -71,8 +71,7 @@ function dialog_example_ajax_callback($ajax) {
 
     $commands = array();
     $commands[] = dialog_command_display($content, $options);
-    $result = ajax_render($commands);
-    echo $result;
+    ajax_render($commands);
   }
   else {
     // If the user isn't using JavaScript, just show the normal page.
diff --git a/dialog/example/dialog_example.module  b/dialog/example/dialog_example.module
index 3527b15..21d6bfa 100644
--- a/dialog/example/dialog_example.module
+++ b/dialog/example/dialog_example.module
@@ -71,7 +71,8 @@ function dialog_example_ajax_callback($ajax) {
 
     $commands = array();
     $commands[] = dialog_command_display($content, $options);
-    ajax_render($commands);
+    $result = ajax_render($commands);
+    echo $result;
   }
   else {
     // If the user isn't using JavaScript, just show the normal page.
