Made resource loading dynamic