made mag2flux more stable