Consider a proper flat morphism of $k$-schemes ($k$ is an algebraically closed field) $ f:X\longrightarrow\mathbb P^1_k$ such that every fiber $X_p$ for $p\in\mathbb P^1_{\mathbb C}$ is a reduced connected projective *stable* curve of genus $g$.

$X$ is said an

isotrivial family of curvesif there is an open dense subset $U\subseteq\mathbb P^1_{\mathbb C}$ such that all fibers $\{X_p\,:\, p\in U\}$ are smooth and isomorphic.

In literature one can find also the following alternative definition of isotriviality:

$X$ is isotrivial if the the modular map $\varphi_f:\mathbb P^1_{\mathbb C}\longrightarrow \overline{M_g}$ is constant. (Here $\overline{M_g}$ is the moduli space of stable curves).

I don't understand why the two definitions are equivalent: in particular the first definition says that the moduli morphism is constant on the open dense subset $U$, but why can we conlude that it is constant on all $\mathbb P^1_{\mathbb C}$ ($\overline{M_g}$ is not Hausdorff)?

isHausdorff for the usual (complex) topology. $\endgroup$