Check the value is valid