Function to load a new script