unity – why isnt this for turning a flashlight on and off working?

i dont know if this matters but I’m using unity 2D. the code only turns the flashlight off and not back on.

`using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class flashlightonoff : MonoBehaviour
{
public static bool flashlightisoff = false;

public GameObject Flashlight;

void Start()
{
    Flashlight.SetActive(true);
}

void Update()
{
    if (Input.GetKeyDown(KeyCode.E))
    {
        if (flashlightisoff)
        {
            ON();
        }
        else
        {
            OFF();
        }
    }
    
}

void ON()
{
    Flashlight.SetActive(true);
    flashlightisoff = false;
}

void OFF()
{
    Flashlight.SetActive(false);
    flashlightisoff = true;
}

}`