Fixed bug with messages being logged twice