fixed huge bug with window leaks