little changes in function getMagnetName