fixed intermittent issue with  webkit based browsers not setting a variable correctly