fix bugs in log