     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 + "\">" + simulatorEscapeHTML(msg.text) + "</div>"
+    $(".simulator-body").append "<div class=\"" + model + " " + direction + "\"></div>"
+
+    $(".simulator-body ." + model + "." + direction + ":last").text(msg.text).html()
+
+
     i++
   $(".simulator-body").scrollTop $(".simulator-body")[0].scrollHeight
   $("#simulator textarea").val ""


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

window.simulation = false
moving_sim = false

window.updateSimulator = (data) ->

