repair errors