fixed window.leaked error