Check correctly for global and window