add length validation