checking for null, enabling logging