support environments with both window and global