fix regression for environments which do not have the global 'window' object
whitespace police raid