Fix bug that log message will output after the next instruction being executed.