fix ema formula