fix bug with logging