fix logging logic