Adding in the error check to not submit the message.