On the submodule of a direct sum of two modules Let $R$ be a ring and $M_1, M_2$ be two $R$-modules (nice properties can be assumed, such as finitely generated, artinian, etc). Let $U$ be a submodule of $M_1\oplus M_2$. Let $\pi_2: M_1\oplus M_2\to M_2$ be the canonical projection. Then it is clear that the sequence of $R$-modules
$$0\to U\cap M_1 \to U \to \pi_2 U \to 0$$
is exact. Though it is clear that $U$ does not necessarily coincide with $U\cap M_1\oplus \pi_2U$, I am wondering if we always have $U$ isomorphic to $U\cap M_1 \oplus \pi_2 U$, as I have some troubles finding counter-examples.
Any comments will be appreciated.

$\newcommand{\Z}{\mathbb{Z}}$Consider $R = \Z$ and the modules $M_{1} = M_{2} = \Z/4$.
Define $U$ by $$U := \{(x, y) \in M_{1} \oplus M_{2} \mid 2x + y = 0\}.$$
Note that $U \cong \Z/4$. (It is generated by $(\bar{1}, \bar{2})$.)
However, $|U \cap M_{1}| = 2$. Since a cyclic group does not have any nontrivial direct summand, we have a counterexample.
(Alternately one can explicitly compute the submodules and check that their direct sum is indeed not isomorphic to $U$.)

I think the above counterexample involves reasonably nice objects ($R$ is Noetherian; modules are Artinian, Noetherian, finite (in all possible ways)).

Edit. The above groups are also modules over $R = \Z/4$. So we have a counterexample where the ring is Artinian and local as well.
