repair an error