get rid of UI after function

This is driving me nuts. ontrigger works fine for the popup but when the player pushes E i want the UI text to go away and not come back when ontriggerenter is called again. I could achieve this by destroying it but keep getting the error that the item is destroyed and im still trying to reference it in the last if statement.
The uiObject.SetActive(false) doesnt work but im assuming because its being called in the triggerenter?

public class LightTheFire : MonoBehaviour
{
public GameObject uiObject;
public GameObject Fire;

private void OnTriggerEnter(Collider other)
{
    if(other.name == "Player")
    {         
       
        uiObject.SetActive(true);            
    }

}

private void OnTriggerExit(Collider other)
{
    if (other.name == "Player")
    {       

      
         uiObject.SetActive(false);
        
    }
}



void Update()
{    //if the UI is on & E is pushed and the fire is not on
    if (uiObject.activeSelf == true && Input.GetKeyDown(KeyCode.E) && Fire.activeSelf == false)
    {
        Fire.SetActive(true); //turn on the fire
        uiObject.SetActive(false); //turn off the text
        //Destroy(uiObject);           
    }   //activate the fire and deactivate the UI

How do devs generally go about this mechanic? Should i use raycast rather?