corrects the end tag of the labels