North Carolina city will spend $34M to replace dam