Fix IE8 -- console + window.attachEvent