fix bugs in log module