why is my mecanim trigger getting called?

I have a mecanim trigger inside of an if statement that checks the distance of the navmesh agent, yet even though the distance is beyond the float, it gets called at the very beginning. Even taking out the target for the navmesh agent, it still gets called. Any ideas?

if (Input.GetMouseButton(0))
{
RaycastHit hit;

        if (Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out hit, 1000))
        {
            if (hit.collider.CompareTag("Enemy"))
            {
                if (!attackBreak)
                {
                    Target = hit.transform;
                    enemyClicked = true;
                }
                if (attackBreak)
                {
                   // Target = hit.transform;
                    //Debug.Log("uppp");
                }

            }

            
            else if (!hit.collider.CompareTag("Player"))
            {
                if (!attackBreak)
                {
                    agent.destination = hit.point;
                    enemyClicked = false;
                    //anim.SetBool(hashes.attackBool, enemyClicked);
                    agent.Resume();
                }
                if (attackBreak && !clickAway)
                {
                    agent.destination = hit.point;
                    //Debug.Log("wewewe");
                }
            }
        }
    }

    if (enemyClicked)
    {
        float attackDist = 1.3f;

        //agent.destination = Target.position;

        if (agent.remainingDistance >= attackDist)
        {
            agent.Resume();
            Debug.Log("resume");
        }

        if (agent.remainingDistance <= attackDist)
        {
            Attack();
            Debug.Log("attack");
        }
        Debug.Log("Attack1");
    }

Turns out all I needed to do was update to 5.41… Weird but whatever.