Made clicking on button again hide the window wothout glitches