Define console before using it

apparently this breaks IE8/9