Fix bug in logger