adding length validation to docs