fixing logging bug