Mossbauer spectroscopy and magnetic properties of DyMgand ErMg