North Korea has agreed to dismantle its nuclear activities in exchange for aid and energy , but has halted the process several times .