fixed var error with setMagMode