Was the court correct in dismissing the attempted murder charge?

Bert was sitting in a car with Pratt when Jack approached the car, pointed a gun at Bert and fired,
mistakenly killing Pratt. Jack attempted to fire again at Bert, but his gun jammed and would not fire.
Jack jumped into his car, put the gun into the glove compartment, and sped off.
Jack’s attorney moved to dismiss the charge of the attempted murder of Bert on the ground that Jack could not have killed Bert due to the malfunctioning of his gun. The court granted the motion.
Was the court correct in dismissing the attempted murder charge? Be sure to describe the elements
of a criminal act and address impossibility and distinguish if it is a complete or incomplete attempt.