Sprite Velocity

I have a sprite that i have moving correctly in all axis i want him to. Hes supposed to go to an idle animation when the velocity is 0 but the velocity never goes back to zero when moving unless i just slightly tap the movement key. if i press it longer he will play the run animation forever when he stops and the velocity variable isnt going back to 0. its sort of like hes skating on ice and when he stops he keeps moving in place. Anyone have any idea whats wrong?