'Sharp edges' + subsruf modifier giving strange flanging effect?

I’m modelling a simple pill capsule. On the ring around out side casing I’ve added a ‘sharp edges’ flag so that it doesn’t get smoothed by the subsurf. However this causes it to flange out above the rest of the pill. What am I doing wrong? I’ve attached the blend file. Thanks for your help!

pill.blend (503 KB)

At first you need select all and remove double vertices, after that you can use sharp edges with subsurf and edge split modifiers, or just subsurf simple subdivision or you can add one extra loop near that edge. You also should change shading from flat to smooth.

Thanks for your help. Is there a simple way to select the double verts?

go into edit mode, press “a” to select all verts. press “w” to get the menu to remove doubles.

Works perfectly, thanks very much!!!