use the window global variable when we are in a browser