r('id', 'popup').html(`
        <p>` + message + `</p>
        <p>Exit to home page?</p>
        <p><button id=popup-ok>OK</button> <button id=popup-cancel>Cancel</button>`);
    d3.select('#popup-ok').on('click', function () {
      core.endEpisode(-1);
    });
    d3.select('#popup-cancel').on('click', function () {
      d3.selectAll('#username, #password, #subbtn').attr('disabled', null);
      d3.select('#popup').remove();
    });
    popupShown = true;
  }
  var popupMode = core.sample([
      'userna