fix error with bad regions