fixed runtime error with max in doRepair