rewired the page javascript