Fixing a custom data validation function to handle text values as booleans