Fix so closing windows works