added validation for length, presence