use new set_mag, with &block