Issue with document.location.reload