Trouble getting GUI phone to open/close

I am making a GUI mobile phone for my game, and I am having trouble getting it to work. It does not close. Here is my code:

var onoff : boolean;
var testObject : GameObject;
 
function Update () {
    if (Input.GetKeyDown(KeyCode.P)&&onoff == true)
        testObject.active = false; onoff = false;
        
    if (Input.GetKeyDown(KeyCode.P)&&onoff == false)
        testObject.active = true; onoff = true;
    }

Thanks! I added the brackets, and it still didn’t work, but I changed the second if to else if and it worked. I tested it without the brackets and it did not work. So thanks for fixing the brackets for me.