We will prove that if G and H are modules over a principal ideal domain R such that the endomorphism rings EndR(R⊕G) and EndR(R⊕H) are isomorphic then G≅H. Conversely, if R is a Dedekind domain such that two R-modules G and H are isomorphic whenever the rings EndR(R⊕G) and EndR(R⊕H) are isomorphic then R is a PID.