Check for the end of the message