diff --git a/index.html b/index.html
index 51d434ffe04169c103c653351d03cfc8b3ad017b..e6d8dbaca1973094b41bab9b4f52d0787d273328 100644
--- a/index.html
+++ b/index.html
@@ -21,11 +21,16 @@
 
 	<script type="text/javascript">
 	function generateQR() {
-		new QRCode(document.getElementById("qrcode"), location.hash.substring(1));
+		var qrcode = new QRCode(document.getElementById("qrcode"), location.hash.substring(1));
 	}
 	$( document ).ready(function() {
 		generateQR();
 	});
+
+	window.addEventListener('hashchange', function() {
+		qrcode.clear(); 
+		qrcode.makeCode(location.hash.substring(1));
+	});
 			
 	</script>