Added code to use window or global and assign to window object.