Let $X$ be a standard Borel space: that is, a topological space equivalent to a Borel subset of $\Bbb R$. It is known that for any probability measure $p$ on $X$ and any universally measurable set $A\subseteq X$ there exists a Borel set $B\subseteq X$ such that $p(A\Delta B) = 0$. Moreover, if $f:X\to\Bbb R$ is universally measurable, there exists a Borel-measurable $f'$ such that $f=f'$ $p$-a.e.
I wonder, whether the following result holds true:
If $Y$ is also a Borel space and $g:X\to Y$ is universally measurable, there exists a Borel map $g':X\to Y$ such that $g = g'$ $p$-a.e.
A possible proof that I have in my mind is the following: the countable case is trivial, so assume that $Y$ is uncountable, then there exists a Borel isomorphism $\phi:Y\to\Bbb R$. As a result, we can say that $$ g = \phi^{-1}\circ (\phi\circ g) $$ where $\phi\circ g:X\to\Bbb R$ is clearly universally measurable. Hence, there exists a Borel function $f':X\to\Bbb R$ such that $\phi\circ g = f'$ $p$-a.e. If we define $g':=\phi^{-1}\circ f'$, we obtain that $g':X\to Y$ is a Borel map and that $g=g'$ $p$-a.e.
Is the proof correct?