#2 Fixing the bug where logging throws