Adding if guard for HAS_CONSOLE.