Change var `window` to `root`.