var dialogIndex = 1;

function displayErrorMessage(message, title, width) {
  if (message === undefined) {
    message = "An unexpected error occured.";
  }
  escapeHtml = escapeHtml(message)
  finalMessage = simpleFormat(escapeHtml)

  $('#error-content').html(finalMessage);
  $('.modal-title').text(title);
  $('#error-modal').modal('open');
}

@@ -154,24 +154,25 @@
   %7D%0A  escape
+d
 Html = escap
@@ -218,24 +218,25 @@
 ormat(escape
+d
 Html)%0A%0A  $('

change the escapeHtml variable name to be different than the funtion escapeHtml name