tweaked if statement to match safari on windows