correct region of interest function