fixed a bug where clicking the close button wouldn't work