replace hardcoded hostname with location.hostname