I'm making a pause menu and set it to open when i press P but i can't get it to close when i press P again how can i do this or fix mine?

So i set the whole pause menu up and the buttons work but i can’t get the widget to close when i press P again

So this is what i have so far but i duo why it not working?

Here’s the solution for the problem, if you’re still interested in solving it.