fix bugs in logger