fix for browsers that don't support visibility API