add collection enforcement

@amuller, @scoen just a minor change
you probably don't need the empty string check [ "".equals(error) ] as you explicitly assign the error string in all cases