Added max length validation support