defer fixing logging bug