logger: fixed a critical bug