Added onPackagesLoaded event