Fixing console to be null safe