Back button stop working after window.print()

I have a modal with two buttons: print and close modal

html:

   <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                        </button>
                        <button class="header__print button--print" title="Print" onclick="printDiv('exportContent')"></button>
                    </div>

JS:

<script type="text/javascript">
function printDiv(divID) {
   var divElements = document.getElementById(divID).innerHTML;
   var oldPage = document.body.innerHTML;
   
   document.body.innerHTML = 
     "<html><head><title></title></head><body>" + 
     divElements + "</body>";

   window.print();

   document.body.innerHTML = oldPage;
}
</script>

The issue appears when I press on print btn and close print modal, then back button stop working.

Any idea why is it happening? thanks!