Fixes logging bug