old_contents: 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');
  }
  
new_contents: var dialogIndex = 1;
  
  function displayErrorMessage(message, title, width) {
    if (message === undefined) {
      message = "An unexpected error occured.";
    }
    escapedHtml = escapeHtml(message)
    finalMessage = simpleFormat(escapedHtml)
  
    $('#error-content').html(finalMessage);
    $('.modal-title').text(title);
    $('#error-modal').modal('open');
  }
  
subject: change the escapeHtml variable name to be different than the funtion escapeHtml name