Adding dataLoaded function to scripts.