WARNING: Spoilers for Avengers: Endgame.

Avengers: Endgame resolves a major plot hole in Avengers: Age of Ultron. As far as Kevin Feige is concerned, the first three phases of the Marvel Cinematic Universe are "The Infinity Saga." They're a single narrative, one that runs from 2008's Iron Man all the way through to Avengers: Endgame. Although Spider-Man: Far From Home will essentially serve as an extended epilogue, that story is now complete.

Avengers: Endgame is a celebration of the Marvel Cinematic Universe, exploiting the concept of time travel to revisit previous movies. Well before release, co-director Joe Russo stated that the then-untitled Avengers 4 would allow fans to "view [previous Marvel movies] through a different lens", and the film definitely provided plenty of opportunities to do just that: as part of the Avengers mission to collect the Infinity Stones to undo Thanos' snap, they must revisit past events.

Related: Every Single MCU Connection & Callback In Avengers: Endgame

One of the highlights was a trip to 2012, when a small band of heroes revisited the events of The Avengers. This wasn't actually in the first drafts of the Endgame script, with Marvel wary of indulging in too much fan-service, and instead they initially planned an extended sequence in which both the Tesseract and the Aether were retrieved from Asgard during Thor: The Dark World. But plans changed, and Marvel made the right call; not only was it thrilling to revisit one of the most iconic superhero films of all time, the time travel jaunt also subtly fixed an Avengers: Age of Ultron plot hole along the way.

Avengers: Age of Ultron's Mind Stone Plot Hole

Loki trying to use his sceptre on Tony Stark in The Avengers

The Avengers ended with Thor using the power of the Tesseract to take Loki back to Asgard, where he would be judged by Odin for his crimes. At the time, nobody noticed one small detail; Loki's Scepter wasn't in the scene, apparently left behind on Earth. That turned out to be quite an important plot point, not least because the Scepter secretly contained the Mind Stone, another of the six Infinity Stones. Avengers: Age of Ultron kicked off with the Avengers launching a strike on a Hydra base, swiftly revealing that Hydra had acquired the Scepter and had been experimenting with it for some years, creating Scarlet Witch and Quicksilver in the process. All this despite the Black Widow having it in her grasp when confronting Loki.

This raised one strange question, however: just how had Hydra gotten their hands on the Scepter? Age of Ultron remained silent on this point, and it was left to an official tie-in prelude comic published on ComiXology to tie up this loose end. Called Avengers: Age of Ultron - This Sceptre'd Isle, this Infinite Comic was set in the immediate aftermath of The Avengers. It focused on two S.H.I.E.L.D. scientists who were attempting to research both the Tesseract and the Scepter, trying to figure out what they had in common. One of these scientists was performing reluctant lab duty because he'd been deemed unfit for fieldwork after a random psychological assessment; overhearing his complaints, Hydra approached him and offered him a chance to join their ranks. Bitter and frustrated, the scientists agreed, helping Hydra to steal the Scepter - and even killing his lab partner to demonstrate his loyalty.

Back in 2015, Marvel was pushing the "It's all connected" philosophy a little more than they are nowadays, so it was easy to understand why they'd leave it to a tie-in to pull together some loose narrative threads. Unfortunately, though, this particular Infinite Comic didn't quite make logical sense. It was clear that Thor was supposed to have left Earth before Hydra stole the Scepter, and yet in Avengers: Age of Ultron he was very much frustrated at the fact it had been missing; why would he have left the Scepter with S.H.I.E.L.D. in the first place?

Related: Is Thor In Guardians of the Galaxy 3?

Avengers: Endgame Explains The Mind Stone Plot Hole

By time traveling to the Battle of New York, Avengers: Endgame provides an alternative explanation. It reveals that the Avengers had barely defeated Loki before S.H.I.E.L.D. began the clean-up operation, with agents Sitwell and Rumlow leading the STRIKE team to Avengers Tower. Although the Avengers didn't know it, these S.H.I.E.L.D. agents were all members of Hydra, and they'd already received orders from Alexander Pierce. Their goal was to acquire any alien technology they could for the secret group, and they easily manipulated the exhausted Avengers into handing over the Scepter.

While this area of the film is ripe with alternate timeline discussion, the suggestion in Avengers: Endgame is that the Scepter was stolen immediately after the Battle of New York, with Hydra no doubt pretending it had been misplaced in the chaos. Sitwell was a Level Six operative who seems to have played a major role in the S.H.I.E.L.D. cleanup operation, so he was perfectly positioned for running interference.

Interestingly, between Agents of S.H.I.E.L.D., the Item 47 one-shot, and Spider-Man: Homecoming, there's evidence quite a lot of material went missing from New York, perhaps slipping through gaps that Sitwell had purposefully created for Hydra.

It's true that this directly contradicts a tie-in, although that wouldn't be the first time in the MCU that's happened. Marvel essentially consider the tie-ins to be canon right up until the moment they get in the way of a story they want to tell. James Gunn demonstrated the same attitude with Guardians of the Galaxy Vol. 2, which explicitly contradicted a Guardians of the Galaxy prelude comic. In this case, it's no real loss; the explanation offered in Avengers: Endgame makes far more sense, as it suggests Thor was probably irritated at the loss of the Scepter right from the start but knew he had to take his prisoner back to Asgard as a priority.

Related: Marvel TV Finally Impacts The MCU Movies In Avengers: Endgame (After 6 Years)

This also subtly explains why the Avengers would have been so confident Hydra had the Scepter. Steve Rogers exposed Hydra in Captain America: The Winter Soldier, discovering that Sitwell, Rumlow, and even the STRIKE team were all Hydra operatives. It wouldn't have taken long for the Avengers to remember just who took the Scepter, and deduce that Hydra had it in their possession ahead of Avengers: Age of Ultron.

Next: Avengers: Endgame's Ending & Marvel Movie Future Explained In Detail

Key Release Dates