try to fix a logic error in log