Repair war function