Running loop broken

ok i have a man mc with:

first frame “idle”: normal standing mc
second frame “run” : man running mc

now this is the code on the man mc:

onClipEvent(load){     speed = 5 } onClipEvent(enterFrame){ if(Key.isDown(Key.RIGHT)) this.gotoAndStop("run") onKeyUp = function() { this.gotoAndStop("idle")      }  } onClipEvent(enterFrame){ if(Key.isDown(Key.RIGHT))     _x+=5; }   

the problem is that if i press RIGHT the man is walking right and you see him running, but if i release RIGHT the animation of the man running keeps looping. does anyone know the solution?

ps: long time no see.