Defect repairing in two-dimensional transition metal dichalcogenides