limit the maximum length of messages