fix logging-function