Fixed a bug where sometimes the log message was set twice.