Fixing validation issue with type and validator logic