close button and active window bug