Obama defends his foreign policy record