add the method optional() who disables the checks if value is undefined