change reference for domain from localhost to util function that provides domain