respond to magnet sensor