Modified module loading logic