Added "repair" functionality