use window instead of global var