Fix undefined `logger` variable