run animation in loop

i made a walk animation in unity,
but when i walk it only walks one time and stops,
how can i make the animation walking the whole time when i’m holding the key,

this is my script:

function Update () {
	if(Input.GetButtonDown("walk")){
		animation.Play("walk");
	}
	else if(Input.GetButtonUp("walk")){
		animation.Stop("walk");
	}
}
void Start()
{
    animation["walk"].wrapMode = WrapMode.Loop;
}