diff --git a/webtexttool.module b/webtexttool.module
index 1473742..e70bc56 100644
--- a/webtexttool.module
+++ b/webtexttool.module
@@ -783,7 +783,7 @@ function webtexttool_ajax_render_alter(&$commands) {
   $webtexttool_found = FALSE;
 
   foreach ($commands as $command) {
-    if (isset($command['data']) && substr($command['data'], 0, 29) == '<div id="webtexttool-analyse"') {
+    if (isset($command['data']) && is_string($command['data']) && substr($command['data'], 0, 29) == '<div id="webtexttool-analyse"') {
       $webtexttool_found = TRUE;
     }
   }
