not extruding on self intersect on closing

when closing drawing , sometimes line self intersects, on this case the
extrusion is discarted and the drawing erased