fix the index for the error region