changed magnet detection