fixed logging of messages