implemented invalid region exclusion