fix dwim region handling