fixed window leaking bug