how to double jump

why doesnt this code work consistently? i wana double jump and on second jump i wana play the flip animation

    var jumpCount   : int     = 0;

function Update() 
{
    if( Input.GetKeyDown(KeyCode.Space) )
    {
      Jump();
    }
}

function Jump()
{
    jumpCount +=1;

    if( jumpCount == 1 )
    {
       rigidbody.velocity.y = 20;
    }
    else if( jumpCount == 2 )
    {
       rigidbody.velocity.y = 15;
       rigidbody.velocity.x = 2;
       animation.Play("Flip");
    }
}

function OnCollisionEnter( col:Collision ) 
{
	if( col.rigidbody)
	{
		grounded = true;
		jumpCount = 0;
	}
}

sorry i got it fixed…it was my stupid animation. After the flip the animation was still playing for 2 seconds, this is why the flip didnt work when pushing the button fast