 
   # add the progress gif
   if newMessage and newMessage.length <= 160
-    $(".simulator-body").append "<div class=\"imsg to post-message\"></div>"
-    $(".simulator-body .imsg.to.post-message").text(newMessage)
+    $("<div class=\"imsg to post-message\"></div>").text(newMessage).appendTo(".simulator-body")
     $("#simulator textarea").val ""
     $(".simulator-loading").css "display", "block"
     # $(".simulator-body").css "height", $(".simulator-body").height() - 25

    msg = data.messages[i]
    direction = (if (msg.direction is "O") then "from" else "to")
    model = (if (msg.model is "msg") then "imsg" else "ilog")
    $(".simulator-body").append "<div class=\"" + model + " " + direction + "\"></div>"
    $(".simulator-body ." + model + "." + direction + ":last").text(msg.text)
    i++
  $(".simulator-body").scrollTop $(".simulator-body")[0].scrollHeight
  $("#simulator textarea").val ""


    # add the progress gif
    if newMessage and newMessage.length <= 160
      $("<div class=\"imsg to post-message\"></div>").text(newMessage).appendTo(".simulator-body")
      $("#simulator textarea").val ""
      $(".simulator-loading").css "display", "block"
      # $(".simulator-body").css "height", $(".simulator-body").height() - 25
