prevent js exception when window.focus isn't found