Because he's time travelling, he visits his past (and the younger himself's present) to stop the viruses being released. Cole has realised that The Army of the Twelve Monkeys is actually just a red herring, and all they've done is release some animals from the zoo - he sends the message to the scientists in the future, telling them they're on the wrong track. As he does that, he is confronted by Jose, an aquaitance from his own time, who gives Cole a handgun and tells him to complete his mission; at this time, Railly spots the culprit behind the actual viruses, Dr. Peters, not the Twelve Monkeys. Peters is about to board an airplane and complete a tour of cities around the world, in the sequence memorised by Cole of viral outbreaks. Cole is then fatally shot as he tries to kill Peters, and dies in Railly's arms - she makes eye contact with a small boy, which is the young James Cole witnessing his own death in the future (but at the same time location-wise) - this sets about his recurring nightmare. Dr. Peters then sits down on the plane next to Jones, one of the lead scientists of the future and someone who "helped" Cole time travel.