add maxlength constraint