added a new exception and added repair_string()