Added support for max length