Add maximum length functionality