GIF Animation help

I can’t seem to get my gif image to stop looping.
So initially I set up an animated image module and I wanted it to stop when the music player stopped playing hence I implemented the script $if(mi(state)=playing, LOOP, STOP)$ .

Now the funny thing is, when viewed from editor it appears to work. But not on my home screen. The GIF keeps looping.

Add an animation, ReactOn formula, if(mi(state)! =playing, fade out