fixed maxLength issues