My character won't stop crouching, they dont stop crouchin

My character won’t stop crouching

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

public class PlayerMovment : MonoBehaviour {

    public CharacterController2D controller;

    public float runSpeed = 40f;

    float horizontalMove = 0f;
    bool jump = false;
    bool crouch = false;
    

    // Update is called once per frame
    void Update()
    {
        horizontalMove = Input.GetAxisRaw("Horizontal") * runSpeed;

        if (Input.GetButtonDown("Jump"))
      {
           jump = true;
      }
        if (Input.GetButtonDown("Crouch"))
        {
            crouch = true;
        } else if (Input.GetButtonUp("Crouch")) 
        {
            crouch = false; 
        }

      
    }
    void FixedUpdate ()
    {
        // Move Character
        controller.Move(horizontalMove * Time.fixedDeltaTime, crouch, jump);
        jump = false;
    }
    
}

I think you should change GetButtonDown to GetKeyDown. I hope it works.

I found my own mistake I have forgotten to add and select the layer for the player and the ground because of that the ground detection hasn’t work right.