fixed ensureWindow bug, removed cache for now