Fix window bug