change reference for domain from localhost to util function that provide...

...s domain