Direct factor is not intersection-closed

Statement
The intersection of two direct factors of a group need not be a direct factor. In fact, this property is not even true within $$p$$-groups.

The counterexample
Let $$C_n$$ denote the cyclic group on $$n$$ elements. Then, consider the group $$C_p \times C_{p^2}$$. Consider the automorphism $$\sigma$$ of this group which sends the pair $$(a,b)$$ to $$(a+b,b)$$. Consider the intersection of the group $$C_{p^2}$$ (which is a direct factor) with its image under $$\sigma$$. This is basically the subgroup of $$C_{p^2}$$ comprising elements which are multiples of $$p$$. Clearly, this is not a direct factor, in fact it is not even a direct factor inside $$C_{p^2}$$.