John F. Kennedy was elected president in 1960 over Richard Nixon because people felt the US was losing the Cold War and Kennedy appeared cooler in televised debates. The Bay of Pigs invasion, in which the US backed Cuban exiles to overthrow Fidel Castro, failed and made Kennedy look weak. In 1961, the Soviet Union built the Berlin Wall to stop East Germans from fleeing to West Berlin. The Cuban Missile Crisis in 1962, when the US discovered Soviet nuclear missiles in Cuba, brought the world the closest it had been to nuclear war but was resolved through negotiations.