made window actually dispose after X is pressed