fix leak window bug