Fixed 'console is undefined' error