fixed sed taking last message on invalid pattern