while there were some critical ideological differences between north korea and pakistan , they had collaborated for some time to ensure that both had the capability to launch nuclear missiles at their enemies .