Validating a variable's value