partially fix logging