Ransom

While multi-millionaire Tom Mullen and his wife Kate attend a science fair, their son Sean is kidnapped. Sean is taken to an apartment by Maris, a caterer for the Mullens, along with criminals Clark, Cubby and Miles, and Detective Jimmy Shaker, Maris's boyfriend and the mastermind behind the kidnapping. Tom and Kate receive an e-mail from the kidnappers demanding $2,000,000. Tom calls the FBI, who begin operating from his New York City penthouse under Special Agent Lonnie Hawkins. In private, Tom voices his belief that a union machinist, Jackie Brown, who is in prison following one of Mullen's business scandals, may have been behind it. They visit Brown in prison, but he angrily denies any involvement with the kidnapping.
Tom agrees to the FBI's instructions for delivering the ransom. Receiving a phone call from Shaker, who is electronically disguising his voice, Tom follows his instructions. He meets Cubby in a New Jersey quarry but refuses to hand the money over when Cubby fails to give him the directions Shaker had promised him. A fight ensues and the FBI intervene and shoot Cubby. He dies before he can reveal Sean's location. Shaker later arranges another drop off. While Tom initially agrees to take the money alone, he realizes there is no guarantee Sean will be returned alive and instead appears on television to offer the ransom as a bounty on the kidnappers' heads, promising to withdraw the bounty and drop all charges if the kidnappers return his son alive and unharmed.
Despite the pleadings of Kate and FBI Special Agent Lonnie Hawkins, Tom sticks to his plan, believing it is the best chance of having Sean returned. Shaker lures Kate to a meeting where he tells her to pay the ransom or Sean will die. Tom responds by increasing the bounty to $4,000,000. Shaker calls Tom and demands to be paid, but Tom still refuses, and Shaker fires a gunshot after Tom hears Sean scream for help, leading Tom and Kate to believe their son is dead. Clark and Miles attempt to abandon the plan and flee, but Shaker calls in the NYPD to request backup and kills both of his men while making it look like Miles shot first, and kills Maris after she shoots him in the arm from behind. The NYPD arrive and find Shaker with Sean, believing Shaker found and rescued the boy. Hawkins informs Tom and Kate and they are reunited with their son while Shaker is hospitalized. Tom also recognizes Maris.
Shaker later pays Tom a visit to claim the reward and leave the country before investigators discover his connection with Maris. Tom and Sean, however, recognize Shaker as the kidnapper, and Shaker realizes this. Though his initial plan is to kill everyone in the apartment, Tom persuades him to accompany him to the bank to gain the money and leave peacefully. On the way, however, Tom discreetly alerts Hawkins and the police and FBI converge on Tom and Shaker outside the bank. A chase ensues in which Tom and Shaker grapple furiously before falling through a shop window, severely injuring both and impaling Shaker through the neck. In desperation, Shaker draws a hidden gun but is shot dead by Tom and Hawkins.

Question: How does Tom stop Shaker from killing everyone in the apartment?