setOptional deprecated