moved page change code to the index.html head