actually typeof window.console is needed for IE8

undefined variables can't be referenced directly