Use location.host instead of hardcoded URL