add message length validation to client