fixed bug with loading multiple scripts