move manipulation of flags out of HoistRegion, add OR operator to flags, still fails sample5