My object still follows when dead

How can I stop its position before it dies ? I’m using navmesh agent.

function Start(){
	animation.GetClip("walk01").wrapMode = WrapMode.Loop;
	animation.GetClip("death").wrapMode = WrapMode.Once;
	animation.Play("walk01");
	health = 3;
	player = GameObject.Find("Player");
	zombie = GameObject.Find("zombie");
	attacking = false;
}

function OnTriggerEnter(other : Collider){
	if(other.tag == "shot"){
		health--;
		Destroy(other);
	}
}

function Update(){
	playerDistance = Vector3.Distance(player.transform.position, transform.position);
	if(playerDistance <= 1){
		if(!attacking){
			Invoke("ApplyDamage", 1);
			attacking = true;
		}
	}
	if(health <= 0){
		die();
	}
}

function ApplyDamage(){
	player.SendMessage("SubstractHealth");
	attacking = false;
}

function die(){
	if(!isdead){
		animation.Play("death");
		Destroy(gameObject, 3);
		isdead = true;
	}
}

and my other scripts for following.

var target : Transform;
function Update(){
GetComponent(NavMeshAgent).destination = target.position;
}

//when calling method die do this
//right now the method die is being called every frame that players health is less than 0 This will continue to update the player position. You need to make the method be called only once. I suggest using a boolean that is true at the start of the game and turned off when the function is called once.

die(this.transform);

//change method die to this.
function die(Transform pPosition)
{
     if(!isdead){
         animation.Play("death");
         Destroy(gameObject, 3);
         isdead = true;
         this.transform.position = pPosition.position;
         this.transform.rotation = pPosition.rotation;
     }
}

Cache NavMeshAgent like this

var n = player.GetComponent<NavMeshAgent>();

on Die function you can put

n.Stop();

or at top of Update:

if (isDead)
{
    n.velocity = 0;
    return;
}