update hostname localhost -> window.location.host