title: Bot Framework: Bot responds with "undefined"
body: <p>I have a simple chatbot which takes the user's name and replies asking how it can help them. It works fine in the emulator and webchat but when I tried that as an android app via DirectLine I'm getting an additional prompt which is just empty. So I put some code to log the bot's conversation and I found that the bot is sending a message "undefined" along with the prompt I programmed it to send.</p>
  
  <p><strong>My Code sample</strong></p>
  
  <pre><code>bot.dialog('/', new builder.IntentDialog()
      .matchesAny([/hi/i], [
          function (session) {
              session.send('Hi, I am a chatbot.');
              session.beginDialog('/step2')
          },
          bot.dialog('/step2', [
              function (session) {
                  builder.Prompts.text(session, 'What is your name?');
              },
              function (session, args, next) {
                  session.send('Hello, ' + args.response + '. How may I help you today?');
                  name = args.response;
                  session.endConversation();
              }
          ])
      ]));
  </code></pre>
  
  <p>When I put in some middleware logging, I got the following output:</p>
  
  <blockquote>
    <p>USER: Hi  </p>
    
    <p>BOT: Hi, I am a chatbot. </p>
    
    <p>BOT: What is your name? </p>
    
    <p>USER: Bob</p>
    
    <p>BOT: Hello, Bob. How may I help you today?</p>
    
    <p>BOT: undefined</p>
  </blockquote>
  
  <p>Even my node console shows that 2 messages are sent at the end instead of just one</p>
  
  <pre><code>ChatConnector: message received.
  UniversalBot("*") routing "Anish" from "emulator"
  Library("BotBuilder").findRoutes() explanation:
          ActiveDialog(0.5)
  ..BotBuilder:prompt-text - Prompt.returning(Anish)
  ..BotBuilder:prompt-text - Session.endDialogWithResult()
  ./step2 - waterfall() step 2 of 2
  ./step2 - Session.send()
  ./step2 - Session.endConversation()
  Session.sendBatch() sending 2 message(s)
  </code></pre>
  
  <p>Why is that undefined message being sent? How can I stop it?</p>