Javascript GUI error (547435)

if the GUI is up when the player dies it stays up after respawn even though the player is out of the OnTriggerEnter for the GUI I know its probably because the player is teleported rather than moving out of the OnTriggerExit how do i fix this im new to programming as a whole let alone GUI

#pragma strict
var theDoor : Transform;
private var doorIsClosed = true;
private var drawGUI = false;
function Update ()
{
    if (drawGUI == true && Input.GetKeyDown(KeyCode.F))
    {
        changeDoorState();
    }
}
function OnTriggerEnter (theCollider : Collider)
{
    if (theCollider.tag == "Player")
    {
        drawGUI = true;
    }
}
function OnTriggerExit (theCollider : Collider)
{
    if (theCollider.tag == "Player")
    {
        drawGUI = false;
    }
}
function OnGUI ()
{
    if (drawGUI == true)
    {
        GUI.Box (Rect (Screen.width*0.5-51, 400, 102, 22),"Press F to open");
    }
}
function changeDoorState ()
{
    if (doorIsClosed == true)
    {
        theDoor.animation.CrossFade("Door Open");
        //theDoor.audio.PlayOneShot();
        doorIsClosed = false;
        yield WaitForSeconds(3);
        theDoor.animation.CrossFade("Door Close");
        //theDoor.audio.PlayOneShot();
        doorIsClosed = true;
    }
}

Duplicate topics are not allowed.

–Eric