Autoclose window when removing modules