added repair-mode, some bugs fixed
added repair-mode, some bugs fixed