fix logging bug