Aladdin and his friends find Hamed and his caravan walking in a desert before Agrabah existed. They tell Hamed to settle in the desert and Hamed agrees. At night, he gets tackled by Abis Mal and Abnor Mal and gets thrown in an hourglass-shaped portal. Aladdin and Genie find Hamed stuck in a tar pit at a prehistoric landscape. After getting Hamed back in the desert and Aladdin takes Abis' magic hourglass, the glass breaks and a giant portal sucks everyone in, where a battle ensues. Later, Hamed sees Agrabah from a portal and begins to understand Aladdin's suggestion. After getting back in the desert and Aladdin and his friends go back to their time and after banishing Abnor for his betrayal, Hamed and his group are going to find Agrabah.