magnet detection