implemented maxlength for text input