Use window for the global var.