validate length