Add input validation for datasets