Auto Targeting script issue

Hi everyone, I’m trying to have bullets auto target.
So far I have it working on all targets but when target gets destroyed and when new target selected bullet no longer are auto targeting. Can someone please help here is the Js script:

var target : GameObject;

var targetAlive : boolean = false;

function Update ()
{

if(Enemy_Collisions.e_alive)
{
	if(targetAlive == true)
	{
	var new_target : Vector3 = target.transform.position - transform.position;
	
	rigidbody.velocity = new_target.normalized * 100;
	transform.LookAt(target.transform.position);
	}
}
if(!Enemy_Collisions.e_alive)
{
targetAlive = false;
}

}

make sure that target is never null otherwise that functionnality must be disabled . What you can do is calling a coroutine for each bullet instantiated , that coroutine is simply lookat(target) at each second for instance. Then it moves forward , until the distance between the bullet and the target is small enough , then call auto bomb and destroy that bullet . That could be a start.