Fix window leak