fixed some bugs in log