made more general by adding an env var for the domain