fix bug: logging is not correct.