Fix window drag exception