Adding border to line renderer

I am trying to add border to my line renderer .I made a shader which has black borders , and white in the middle. But , in the edge of the line I am unable to get the border as i desired , i added end cap vertices to make the line look round in the corner , where the shader is applying in unexpected way.

This is why - because there is no valid UV there: