removed reference to 'window' - works browser-side only