Fix conditional for detected when not to log the message.