fixed #3 by using hostname from the window.location object